import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 文件夹路径
  resolve:{
    alias:{
      "@":path.resolve(__dirname,'src')
    }
  },
  server: {
    // 跨域的写法
        proxy: {
          '/api': {
            target: 'http://localhost:3000', // 实际请求地址
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ""),
          },
        },
      },
})